<template>
  <span>
    <a-tag v-if="record.supid" @click="subClick(record.supid)" color="red"> 督办记录 </a-tag>
    <a-tag v-if="record.repeatid" @click="repClick(record.repeatid)" color="orange"> 再办记录 </a-tag>
  </span>
</template>

<script>
import { viewCre_work_sup } from '@/api/correction/cre_work_sup.js'
import { viewCre_work_repeat } from '@/api/correction/cre_work_repeat.js'
export default {
  props: {
    record: {
      type: Object,
      require: true,
    },
  },
  data() {
    return {}
  },
  created() {
  },
  methods: {
    // 再办任务详情
    async repClick(id) {
      const { data } = await viewCre_work_repeat(id)
      if(null == data) {
        this.$message.error('未找到再办任务详情')
        return
      }
      this.$info({
        title: '再办信息',
        content: data.remark,
        okText: '关闭'
      })
    },
    // 督办任务详情
    async subClick(id) {
      const { data } = await viewCre_work_sup(id)
      if(null == data) {
        this.$message.error('未找到督办任务详情')
        return
      }
      this.$info({
        title: '督办信息',
        content: data.remark,
        okText: '关闭'
      })
    }
  },
}
</script>

<style lang="scss" scoped>
</style>
